class ComplexNumber{
	int a,b;
	ComplexNumber(int a,int b){  
		this.a = a;		this.b = b;		
	}
	void print(){		
		System.out.println(a + "+" + b + "i");	
	}
	ComplexNumber add(ComplexNumber c){
		return new ComplexNumber(c.a+this.a, c.b+this.b);
	}
	public static void main (String[] args) {		
		ComplexNumber c1 = new ComplexNumber(5,6);
		ComplexNumber c2 = new ComplexNumber(7,8);
		ComplexNumber c3 = new ComplexNumber(9,10);
		ComplexNumber c4 = c1.add(c2).add(c3);		
		c4.print();
	}
}